﻿using System.Web.Http;
using System.Web.Mvc;

namespace CNKI.TPI.Web.Interface.Areas.User
{
    public class UserAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "User";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            GlobalConfiguration.Configuration.Routes.MapHttpRoute(
                 name: "User_default",
                 routeTemplate: "api/User/{controller}/{action}/{id}",
                 defaults: new
                 {
                     action = RouteParameter.Optional,
                     id = RouteParameter.Optional,
                     namespaceName = new string[] { string.Format("CNKI.TPI.Web.Interface.Areas.{0}.Controllers", this.AreaName) }
                 }
             );
        }
    }
}
